<!DOCTYPE html>
<!--
	作者：501394006@qq.com
	时间：2018-09-27
	描述：评价晒单
-->
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../plugins/layui/css/layui.css" />
		<script src="../plugins/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div>
			<!--
            	作者：501394006@qq.com
            	时间：2018-09-27
            	描述：头部工具栏
            -->
			<script type="text/html" id="toolbarDemo">
				<div class="layui-form-item layui-input-inline">
					<div class="layui-input-inline">
						<select lay-event="goodstype" name="">
							<option value="">展示所有</option>
							<optgroup label="办公家具">
								<option value="厨具">厨具</option>
								<option value="厨具">家具</option>
							</optgroup>
							<optgroup label="电脑数码">
								<option value="手机">手机</option>
								<option value="电脑">电脑</option>
							</optgroup>
							<optgroup label="服饰鞋帽">
								<option value="男装">男装</option>
								<option value="女装">女装</option>
							</optgroup>
						</select>
					</div>
					<div class="layui-input-inline">
						<select>
							<option value="请选择">请选择</option>
							<option value="按订单号">按订单号</option>
							<option value="按用户名">按用户名</option>
							<option value="按商品名">按商品名</option>
						</select>
					</div>
					<div class="layui-input-inline">
						<input type="text" id="search" name="search" required placeholder="请输入搜索关键字" class="layui-input" />
					</div>
					<div class="layui-input-inline">
						<button lay-event="find" class="layui-btn layui-btn-normal layui-btn-radius">搜索</button>
					</div>
				</div>
			</script>
			<!--
            	作者：501394006@qq.com
            	时间：2018-09-27
            	描述：表格操作栏
            -->
			<script type="text/html" id="col_bar">
				<div>
					<button lay-event="delete" class="layui-btn layui-btn-sm layui-btn-danger">删除</button>
				</div>
			</script>
			<!--
            	作者：501394006@qq.com
            	时间：2018-09-27
            	描述：表格
            -->
			<table class="layui-table" lay-data="{
				url:'../dataset/judgedata.json', 
				page:true, 
				id:'test',
				toolbar:'#toolbarDemo'
				}" lay-filter="test">
				<thead>
					<tr>
						<th lay-data="{field:'order_id',align:'center', sort: true}">订单号</th>
						<th lay-data="{field:'goods_name',align:'center'}">商品名称</th>
						<th lay-data="{field:'uname',align:'center'}">用户名</th>
						<th lay-data="{field:'content',align:'center'}">评价内容</th>
						<th lay-data="{field:'images',align:'center'}">晒图</th>
						<th lay-data="{field:'judge_date',align:'center', sort: true,}">评价时间</th>
						<th lay-data="{field:'add_content',align:'center'}">追评内容</th>
						<th lay-data="{field:'add_date',align:'center'}">追评时间</th>
						<th lay-data="{field:'wealth',toolbar:'#col_bar',align:'center'}">操作</th>
					</tr>
				</thead>
			</table>

		</div>
	</body>
	<script type="text/javascript">
		layui.use(['table', 'layer', 'form'], function() {
			var table = layui.table;
			var lay = layui.layer;
			var form = layui.form;
			//单击事件
			table.on('tool(test)', function(obj) {
				if(obj.event === 'delete') {
					lay.confirm("确定删除吗?", {
						icon: 3,
						title: "提示"
					}, function(index) {
						lay.close(index);
						obj.del();
					});
				}
			});

			table.on('toolbar(test)', function(obj) {
				switch(obj.event) {
					case 'find':
						layer.msg("搜索");
						break;
					case 'goodstype':
						layer.msg('类型');
						break;
				};

			});
			form.on('select()', function(data) {
				layer.msg(data.value);
			});
		});
	</script>

</html>